package com.jijs.service;

import java.util.List;

import javax.jws.WebService;

import com.jijs.bean.User;
import com.jijs.dao.UserDAO;
import com.jijs.exception.UserException;

@WebService(endpointInterface="com.jijs.service.IUserService",
		wsdlLocation="META-INF/wsdl/user.wsdl",
		serviceName="userService",
		portName="userServicePort",
		targetNamespace="http://service.jijs.com/user/")
public class UserServiceImpl implements IUserService {

	private UserDAO userDAO = UserDAO.getInstance();
	
	@Override
	public void add(User user) throws UserException {
		userDAO.add(user);
	}

	@Override
	public void delete(String username) {
		userDAO.delete(username);
	}

	@Override
	public List<User> list() {
		return userDAO.list();
	}

	@Override
	public User login(String username, String password) throws UserException {
		return userDAO.login(username, password);
	}

}
